API Documentation
Public Member Functions | List of all members
nkGraphics::ConfigReader Class Reference

A reader for a configuration source. More...

Public Member Functions

 ConfigReader ()
 
 ~ConfigReader ()
 
bool readConfigFile (const char *fileNameStr, ConfigHolder &toCopyInto)
 
bool readConfigSource (const char *sourcesStr, ConfigHolder &toCopyInto)
 
bool saveConfigToFile (const char *fileNameStr, ConfigHolder &toSave)
 
std::string saveConfigToSource (ConfigHolder &toSave)
 

Detailed Description

A reader for a configuration source.

Constructor & Destructor Documentation

◆ ConfigReader()

nkGraphics::ConfigReader::ConfigReader ( )

Constructor.

◆ ~ConfigReader()

nkGraphics::ConfigReader::~ConfigReader ( )

Destructor.

Member Function Documentation

◆ readConfigFile()

bool nkGraphics::ConfigReader::readConfigFile ( const char *  fileNameStr,
ConfigHolder toCopyInto 
)

Reads a configuration file, from a path.

Parameters
fileNameStrThe file path, relative to the execution path.
toCopyIntoThe configuration holder to populate.
Returns
Whether the parsing went well (true) or not (false).

◆ readConfigSource()

bool nkGraphics::ConfigReader::readConfigSource ( const char *  sourcesStr,
ConfigHolder toCopyInto 
)

Reads a configuration source.

Parameters
sourcesStrThe sources to read.
toCopyIntoThe configuration to populate.
Returns
Whether the parsing went well (true) or not (false).

◆ saveConfigToFile()

bool nkGraphics::ConfigReader::saveConfigToFile ( const char *  fileNameStr,
ConfigHolder toSave 
)

Saves the configuration into a file.

Parameters
fileNameStrThe file path, relative to the execution path.
toSaveThe configuration to save.
Returns
Whether the saving went well (true) or not (false).

◆ saveConfigToSource()

std::string nkGraphics::ConfigReader::saveConfigToSource ( ConfigHolder toSave)

Saves the configuration's sources.

Parameters
toSaveThe configuration to translate.
Returns
The source for the configuration given.

The documentation for this class was generated from the following file: